<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Edit
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<% using (Html.BeginForm())
	{ %>
	<div class="pagetitle">
		<h1>
			Mail settings</h1>
	</div>
	<div class="pagecontent">
		<%= Html.ValidationSummary("Creation was unsuccessful. Please correct the errors and try again.") %>
		<table class="columns">
			<tr>
				
				<td class="column twothirds">
					<div class="innercolumn">
						<fieldset class="group">
							<legend>Content</legend>
							<div class="groupcontent">
								<p>
									<label for="subject">
										Subject</label>
									<%= Html.TextBox("subject")%>
									<%= Html.ValidationMessage("subject")%>
								</p>
								<p>
									<label for="htmlbody">
										HTML body</label>
									<%= Html.TextArea("htmlbody", null, new { style = "width:100%;height:300px;" })%>
									<%= Html.ValidationMessage("htmlbody")%>
								</p>
								<p>
									<label for="plaintextbody">
										Plaintext body</label>
									<%= Html.TextArea("plaintextbody", null, new { style="width:100%;height:200px;" } )%>
									<%= Html.ValidationMessage("plaintextbody")%>
								</p>
								
							</div>
						</fieldset>
					</div>
				</td>
				<td class="column onethird last">
					<div class="innercolumn">
						<fieldset class="group">
							<legend>Basic settings</legend>
							<div class="groupcontent">
								<p>
									<label for="name">
										Internal name:</label>
									<%= Html.TextBox("name") %>
									<%= Html.ValidationMessage("name") %>
								</p>
								<p>
									Recipient lists:<br />
									<% foreach (var v in (IList<Mailer.Model.Types.List>)ViewData["Lists"])
			{ %>
									<input type="checkbox" name="lists" value="<%=v.ID%>" <%= ((IList<Mailer.Model.Types.List>)ViewData["SelectedLists"]).Contains(v)?"checked=\"checked\"":"" %>>
									<%= v.Name %><br />
									<% }  %>
								</p>
								<p>									
									<%= Html.CheckBox( "isarchived", ViewData["isarchived"] )%> Archive this mail
								</p>
							</div>
						</fieldset>
						<fieldset class="group">
							<legend>Sender</legend>
							<div class="groupcontent">
								<p>
									<label for="senderemail">
										Sender E-Mail</label>
									<%= Html.TextBox("senderemail") %>
									<%= Html.ValidationMessage("senderemail")%>
								</p>
								<p>
									<label for="sendername">
										Sender Name</label>
									<%= Html.TextBox("sendername") %>
									<%= Html.ValidationMessage("sendername")%>
								</p>
								<p>
									<label for="recipientemail">
										Recipient E-Mail</label>
									<%= Html.TextBox("recipientemail")%>
									<%= Html.ValidationMessage("recipientemail")%>
								</p>
								<p>
									<label for="recipientname">
										Recipient Name</label>
									<%= Html.TextBox("recipientname") %>
									<%= Html.ValidationMessage("recipientname")%>
								</p>
								<p>
									<label for="replytoemail">
										Reply-to E-Mail</label>
									<%= Html.TextBox("replytoemail")%>
									<%= Html.ValidationMessage("replytoemail")%>
								</p>
							</div>
						</fieldset>
					</div>
				</td>
			</tr>
		</table>
	</div>
	<div class="pageactions">
		<p>
			<input type="submit" class="button" value="Update mail" />
		</p>
	</div>
	<% } %>
</asp:Content>
